/** @odoo-module **/

import { registry } from "@web/core/registry";
import { session } from "@web/session";

export const layoutConfigService = {
    dependencies: [],
    
    start() {
        // 添加调试日志
        console.log('[Web Layout Enhance] Service starting...');
        console.log('[Web Layout Enhance] Session object:', session);
        console.log('[Web Layout Enhance] menu_position:', session.menu_position);
        console.log('[Web Layout Enhance] enable_multi_tab:', session.enable_multi_tab);
        
        const menuPosition = session.menu_position || 'top';
        const enableMultiTab = session.enable_multi_tab || false;
        
        console.log('[Web Layout Enhance] Final config:', { menuPosition, enableMultiTab });
        
        return {
            menuPosition,
            enableMultiTab,
            isSidebarMenu() {
                return menuPosition === 'sidebar';
            },
            isMultiTabEnabled() {
                return enableMultiTab;
            },
        };
    },
};

registry.category("services").add("layoutConfig", layoutConfigService);

